home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Developer Utilities / Installer 4.0.3 SDK / Script Examples / Rsrc Compression Example / Makefile next >
Encoding:
Makefile  |  1994-11-15  |  5.5 KB  |  131 lines  |  [TEXT/MPS ]

  1. #
  2. #    makefile for "rsrcCompress.r", the example for InstaCompOne resource compression
  3. #
  4. #
  5. #        to build installer script :
  6. #            1) select "Build" from "Build" menu
  7. #            2) type script name "fileCompress" ( note: ".r" is omitted )
  8. #            
  9. #        to build debug version of installer script :
  10. #            1) select "Build" from "Build" menu
  11. #            2) type script name "fileCompress.debug" ( note: ".r" is omitted )
  12. #            
  13. #
  14. #    mark young - 08/17/94
  15. #
  16.  
  17. # • script names
  18.  
  19. # the installer script name
  20. scriptName                = rsrcCompress
  21. # the debug version installer script name
  22. debugScriptName            = "{scriptName}.debug"
  23. # filename for ScriptCheck extension that will run when ScriptCheck does
  24. localScriptCheckExtName    = {scriptName}.scx
  25.  
  26.  
  27. # • tool names
  28.  
  29. # InstaCompOne compression tool
  30. compressTool            = :::InstaCompOne 1.0:InstaCompOneTool
  31.  
  32. # Splitting tool
  33. splitTool                = :::InstaCompOne 1.0:FileAndRsrcSplitterTool
  34.  
  35. # Original ScriptCheck Extension
  36. ScriptCheckExtension    = :::InstaCompOne 1.0:InstaCompOneSCExt.rsrc
  37.  
  38. # • support directory names
  39.  
  40. # directory where ScriptCheck MPW tool can be found
  41. ScriptCheckDir            = :::ScriptCheck 4.0.3:
  42. # directory where RIncludes can be found
  43. InstallerRIncDir        = :::DeveloperInterfaces:RIncludes:
  44. # directory where the Installer Debugger can be found
  45. InstallerDebuggerDir    = :::Installer Debugger 4.0:
  46.  
  47.  
  48. # source file containing the two example resources
  49. SourceFileName    = source.rsrc
  50.  
  51. # • simple compression example
  52.  
  53. # archive containing compressed resource
  54. CompressedRsrcArchive   = :Disk 1:CompressedRsrcTome
  55.  
  56. # • split compression example
  57.  
  58. # interim file containing both pieces of split resource
  59. TempSplitFile            = SplitResource
  60. # interim file containing first piece of split resource
  61. TempRenamedFile1        = SplitResourceRenamed1
  62. # interim file containing second piece of split resource
  63. TempRenamedFile2        = SplitResourceRenamed2
  64. # archive containing first split and compressed piece
  65. SplitCompRsrcArchive1   = :Disk 1:SplitCompRsrcTome1
  66. # archive containing second split and compressed piece
  67. SplitCompRsrcArchive2   = :Disk 2:SplitCompRsrcTome2
  68.  
  69.  
  70. # • split example
  71.  
  72. # interim file containing both pieces of split resource
  73. TempSplitFile2            = SplitResource2
  74. # archive containing first split piece
  75. SplitRsrcArchive1       = :Disk 1:SplitRsrcTome1
  76. # archive containing second split piece
  77. SplitRsrcArchive2       = :Disk 2:SplitRsrcTome2
  78.  
  79. # make the debug version of finished installer script
  80. "{debugScriptName}" ƒ {scriptName}
  81.     # make a copy of the finished installer script and rename the copy
  82.     Duplicate -y "{scriptName}" "{scriptName} w/ Debugger"
  83.     # add the installer debugger resources to the copied installer script
  84.     Rez -m "{InstallerDebuggerDir}Installer Debugger.r" -append -o "{scriptName} w/ Debugger"
  85.  
  86. # make the standard version of finished installer script
  87. "{scriptName}" ƒƒ makefile "{scriptName}.r" "{CompressedRsrcArchive}" "{SplitCompRsrcArchive1}" "{SplitRsrcArchive1}" "{localScriptCheckExtName}"
  88.     # establish current date with time of NOON
  89.     set theTime    "'`date -d -s` 12:00:00 PM'"
  90.     # rez the installer source into the form that the installer can read
  91.     Rez "{scriptName}.r" -o "{scriptName}" -t 'kajr' -c 'kajr' -i "{InstallerRIncDir}" 
  92.     # establish filename for finished installer script, set creation date and time, set attributes
  93.     SetFile -a b -d {theTime} "{scriptName}"
  94.     # run scriptcheck utility on the rezzed installer script
  95.     "{ScriptCheckDir}ScriptCheck" "{scriptName}" -h -d -a
  96.     # set modification date and time for finished installer script
  97.     SetFile -m {theTime} "{scriptName}"
  98.  
  99. # be sure that's there's a copy of the InstaCompOne ScriptCheck extension in current folder
  100. "{localScriptCheckExtName}" ƒ "{ScriptCheckExtension}"
  101.     # copy and rename the original scriptcheck extension
  102.     duplicate "{ScriptCheckExtension}" "{localScriptCheckExtName}"
  103.  
  104. # do the simple resource compression
  105. "{CompressedRsrcArchive}" ƒ makefile "{SourceFileName}"
  106.     # compress resource 'STR#' ( 9000 ) into a rsrc item within archive
  107.     "{compressTool}" "{SourceFileName}" -k 'STR#'=9000 -a 'part'=9000 -o "{CompressedRsrcArchive}"
  108.  
  109. # do the split compression
  110. "{SplitCompRsrcArchive1}" ƒ makefile "{SourceFileName}"
  111.     # split resource 'STR#' ( 9001 ) into parts no larger than 7K 
  112.     "{splitTool}" "{SourceFileName}" -k 'STR#'=9100 -s 7000 -a 'temp'=9100 -o "{TempSplitFile}"    
  113.     # give the first split piece the original resource type, copy into an interim file
  114.     echo "include ∂"{TempSplitFile}∂" 'temp'(9100) AS 'STR#'(9100);" | Rez -o "{TempRenamedFile1}" -t 'rsrc' -c 'RSED'
  115.     # compress contents of first rsrc piece within interim file into first archive
  116.     "{compressTool}" "{TempRenamedFile1}" -k 'STR#'=9100 -a part=9100 -o "{SplitCompRsrcArchive1}"     
  117.     # give the second split piece the original resource type, copy into another interim file
  118.     echo "include ∂"{TempSplitFile}∂" 'temp'(9101) AS 'STR#'(9100);" | Rez -o "{TempRenamedFile2}" -t 'rsrc' -c 'RSED'
  119.     # compress contents of second rsrc piece within interim file into second archive
  120.     "{compressTool}" "{TempRenamedFile2}" -k 'STR#'=9100 -a part=9101 -o "{SplitCompRsrcArchive2}" 
  121.  
  122. # do the split w/o compression
  123. "{SplitRsrcArchive1}" ƒ makefile "{SourceFileName}"
  124.     # split resource 'STR#' ( 9002 ) into parts no larger than 5K 
  125.     "{splitTool}" "{SourceFileName}" -k 'STR#'=9200 -s 5000 -a 'part'=9200 -o "{TempSplitFile2}"
  126.     # copy contents of first rsrc piece within interim file into first archive
  127.     Derez "{TempSplitFile2}" -only "'part'(9200)" | Rez -o "{SplitRsrcArchive1}" -t 'rsrc' -c 'RSED' -a    
  128.     # copy contents of second rsrc piece within interim file into second archive
  129.     Derez "{TempSplitFile2}" -only "'part'(9201)" | Rez -o "{SplitRsrcArchive2}" -t 'rsrc' -c 'RSED' -a    
  130.  
  131.